package day20170407;

import static org.junit.Assert.*;

import java.util.Scanner;

import org.junit.Test;

public class ArrayDemo {
	
	static int bookLength = 5;
	
	@Test
	public void bookTest() throws Exception {

		Scanner scanner = new Scanner(System.in);
		System.out.println("输入你存入书的价格：");
		double[] book = new double[bookLength];
		double sum = 0;
		
		for(int i = 0; i<bookLength; i++){
			book[i] = scanner.nextDouble();
		}
		for(int i = 0; i<bookLength; i++){
			sum += book[i];
			System.out.println("书的价格为："+book[i]);
		}
		
		System.out.println("书的平均数是："+sum/bookLength);
		scanner.close();
	}
	
	
	
}
